package com.text.day1_3.homework;

import java.util.Scanner;

public class ZuoYe {

    public static void main(String[] args) {
        mianJi(1,2,3);
        System.out.println();
        caiXiang();
    }

    public static void mianJi(double a,double b,double c){
        System.out.println("表面积：" + (a * b * 2 + a * c * 2 + b * c * 2));
    }

    public static void caiXiang(){
//        int a = new Scanner(System.in).nextInt();
        Scanner scanner = new Scanner(System.in);
        int a = 0;
        while (a <= 6 || a % 2 != 0){
            System.out.println("输入一个大于6的偶数");
            a = scanner.nextInt();
        }

        for (int i = 2; i <= a / 2; i++)
            for (int j = a; j >= a / 2; j--)
                if (zhiShu(i) && zhiShu(j))
                    if (i + j == a)
                        System.out.println(a + " = " + i + " + " + j);



    }

    public static boolean zhiShu(int a){        //不返回一个质数数组，就判断它是否为质数
        boolean flag = true;
        for (int i = 2; i < a; i++)
            if (a % i == 0)
                flag = false;
        return flag;
    }
}
